
package com.ujoku.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.labillusion.core.util.jsonFormat.SimpleDateSerializer;
import com.labillusion.core.util.jsonFormat.SimpleDoubleSerializer;

import java.util.Date;
import java.util.List;

/**
 * Created by Andy.Lian on 2014/11/1.
 */
public class Order {

    private String id;
    private int memberId;
    private String memberName;
    private String memberPhone;
    private String cartId;
    private Date deliveryDate;
    private Double subTotal;
    private Double total;
    private int deliveryType;
    private String contact;
    private String phone;
    private String province;
    private String city;
    private String county;
    private String shippingAddress;
    private String zipCode;
    @JsonSerialize(using = SimpleDateSerializer.class)
    private Date orderDate;
    private List<OrderItem> orderItemList;
    @JsonSerialize(using = SimpleDoubleSerializer.class)
    private Double discount;
    @JsonSerialize(using = SimpleDoubleSerializer.class)
    private Double discountPercent;
    private String levelName;
    private int level;
    private Double levelDiscount;
    private int status;
    private String statusName;
    private Double shippingFee;
    private Double usedBalanceAmount;

    private String shippingCompany;
    private String trackingNum;
    private Integer storeId;

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getShippingCompany() {
        return shippingCompany;
    }

    public void setShippingCompany(String shippingCompany) {
        this.shippingCompany = shippingCompany;
    }

    public String getTrackingNum() {
        return trackingNum;
    }

    public void setTrackingNum(String trackingNum) {
        this.trackingNum = trackingNum;
    }

    public Double getUsedBalanceAmount() {
        return usedBalanceAmount;
    }

    public void setUsedBalanceAmount(Double usedBalanceAmount) {
        this.usedBalanceAmount = usedBalanceAmount;
    }

    public Double getLevelDiscount() {
        return levelDiscount;
    }

    public void setLevelDiscount(Double levelDiscount) {
        this.levelDiscount = levelDiscount;
    }

    public String getLevelName() {
        return levelName;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberPhone() {
        return memberPhone;
    }

    public void setMemberPhone(String memberPhone) {
        this.memberPhone = memberPhone;
    }

    public Double getShippingFee() {
        return shippingFee;
    }

    public void setShippingFee(Double shippingFee) {
        this.shippingFee = shippingFee;
    }

    public String getStatusName() {
        switch (status){
            case OrderStatus.Cancel:
                return "订单取消";
            case OrderStatus.Created:
                return "待支付订单";
            case OrderStatus.Processing:
                if(this.deliveryType == DeliveryType.DEPOSIT)
                    return "存放至仓库";
                return "订单处理中";
            case OrderStatus.Shipped:
                return "订单发货";
            case OrderStatus.Confirmed:
                return "待评价订单";
            case OrderStatus.Finished:
                return "已完成订单";
        }

        return statusName;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public Double getDiscountPercent() {
        return discountPercent;
    }

    public void setDiscountPercent(Double discountPercent) {
        this.discountPercent = discountPercent;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getMemberId() {
        return memberId;
    }

    public void setMemberId(int memberId) {
        this.memberId = memberId;
    }

    public List<OrderItem> getOrderItemList() {
        return orderItemList;
    }

    public void setOrderItemList(List<OrderItem> orderItemList) {
        this.orderItemList = orderItemList;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCartId() {
        return cartId;
    }

    public void setCartId(String cartId) {
        this.cartId = cartId;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public Double getSubTotal() {
        return subTotal;
    }

    public void setSubTotal(Double subTotal) {
        this.subTotal = subTotal;
    }

    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    public int getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(int deliveryType) {
        this.deliveryType = deliveryType;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getShippingAddress() {
        return shippingAddress;
    }

    public void setShippingAddress(String shippingAddress) {
        this.shippingAddress = shippingAddress;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }
}
